import LocalStorage from '@/utils/LocalStorage'
import axios from 'axios'

export const getDtsToken = (userName: any, pwd: any) => {
  let url = 'http://' + gVar.dtsCloud.player + '/manage/login'
  let data = {
    username: userName,
    password: pwd,
    captcha: ''
  }
  return axios.post(url, data)
}

export const getFreeInstance = (pid: any) => {
  let url = 'http://' + gVar.dtsCloud.player + '/manage/instance/free?pid=' + pid

  return axios.get(url, {
    headers: {
      Authorization: LocalStorage.getItem('ManageAuthorization')
    }
  })
}
